package com.ray.study.sample.test.common.java8.stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * description
 *
 * @author r.shi 2020/04/09 21:18
 */
public class FilterSample {

    public static void distinctSimple() {
        List<String> list = Arrays.asList("a", "b", "c", "c", "b", "a");

        long count = list.stream().distinct().count();
        System.out.println("count of distinct elements:" + count);

        String output = list.stream().distinct().collect(Collectors.joining(","));
        System.out.println(output);
    }




}
